package cn.mxz.xmu.robots.pojo;

import java.io.Serializable;

import net.sf.json.JSONObject;

/**
 * 学校参数对象，为教务机器人提供拉去学校
 * 教务信息提供学校的必要数据
 * 
 * @author kangbin <kangbin@mouge.wang>
 * @since 2015-03-12
 */
public final class School implements Serializable
{
	private static final long serialVersionUID = 1L;
	/* 学校ID */
	private String mId;
	/* 学校名称 */
	private String mName;
	/* 教务数据 */
	private JSONObject mEduObject;
	/* 图书馆数据 */
	private JSONObject mLibObject;
	/* 信息门户数据 */
	private JSONObject mPortalObject;

	/**
	 * 获取教务信息数据
	 * 
	 * @param param
	 * @return
	 */
	public String getEduConfig(String key)
	{
		return mEduObject.getString(key);
	}

	/**
	 * 获取图书馆信息数据
	 * 
	 * @param param
	 * @return
	 */
	public String getLibConfig(String key)
	{
		return mLibObject.getString(key);
	}

	/**
	 * 获取信息门户信息数据
	 * 
	 * @param param
	 * @return
	 */
	public String getPortalConfig(String key)
	{
		return mPortalObject.getString(key);
	}

	public String getId()
	{
		return mId;
	}

	public void setId(String mId)
	{
		this.mId = mId;
	}

	public String getName()
	{
		return mName;
	}

	public void setName(String mName)
	{
		this.mName = mName;
	}

	public void setEduObject(JSONObject mEduObject)
	{
		this.mEduObject = mEduObject;
	}

	public void setLibObject(JSONObject mLibObject)
	{
		this.mLibObject = mLibObject;
	}

	public void setPortalObject(JSONObject mPortalObject)
	{
		this.mPortalObject = mPortalObject;
	}

	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append("id = " + mId);
		sb.append("\nname = " + mName);
		sb.append("\nedu = " + mEduObject);
		sb.append("\nlib = " + mLibObject);
		sb.append("\nportal = " + mPortalObject);
		return sb.toString();
	}
}
